class GitMixin(object):
    def clone(self,git_repo, branch, target_path):
        checkout_dir = """
        cd {target}
        """.format(target=target_path)
        clone_cmd = """
        git clone -b {branch} {origin}
        """.format(
            branch=branch,
            origin=git_repo
        )
        _,stdout,_ = self.execute(checkout_dir)
        if stdout is not None:
            mkdir_cmd = """
            mkdir {target}
            """.format(target=target_path)
            self.execute(mkdir_cmd)
            self.execute(checkout_dir)
        self.execute(clone_cmd)
